/*
 * Copyright © 2017 Cask Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

$connections-panel-bg-color: #efefef;
$connections-panel-border-color: #cccccc;
$connections-menu-active-color: #ff6600;
$connections-menu-item-color: #333333;
$top-panel-bg-color: #efefef;
$border-color: #cccccc;
$top-panel-height: 56px;
$gutter-width: 15px;

.dataprep-connections-container {
  height: calc(100vh - 104px);
  border-right: 1px solid $connections-panel-border-color;

  .top-panel {
    height: $top-panel-height;
    background-color: $top-panel-bg-color;
    border-bottom: 1px solid $border-color;

    .title > h5 {
      padding-left: $gutter-width;
      margin-bottom: 0;
      line-height: $top-panel-height;
      font-weight: 500;

      .fa {
        margin-right: 10px;
        cursor: pointer;
      }
    }
  }

  .connections-panel,
  .connections-content {
    float: left;
    height: 100%;
  }

  .connections-panel {
    width: 250px;
    background-color: $connections-panel-bg-color;
    border-right: 1px solid $connections-panel-border-color;
    position: relative;

    .panel-title {
      margin: 15px 0;
      padding-left: 15px;
      cursor: pointer;

      h5 {
        font-size: 14px;
        font-weight: 600;
      }
    }

    .connections-menu {
      position: absolute;
      top: 45px;
      left: 0;
      right: 0;
      bottom: 70px;
      overflow-y: auto;

      .menu-item {
        padding: 10px 15px 10px 35px;
        cursor: pointer;

        .fa { margin-right: 10px; }

        &:not(:last-child) {
          border-bottom: 1px solid $connections-panel-border-color;
        }

        &.expandable-menu {
          padding: 10px 15px 10px 8px;
        }
        a {
          color: $connections-menu-item-color;
          display: inline-block;
          width: 100%;

          &:active,
          &:focus {
            text-decoration: none;
            outline: 0;
          }
          &:hover {
            text-decoration: none;
            font-weight: 600;
          }

          &.active {
            font-weight: 600;
            color: $connections-menu-active-color;
          }
        }

        .menu-item-expanded-list {
          padding: 10px 27px 10px 54px;
          width: calc(100% - 25px);
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
        }

        .expanded-menu-popover-icon > .fa {
          margin-right: 0;
        }

        &.expandable {
          .expandable-title {
            padding-bottom: 5px;
            user-select: none;
          }
        }
      }
    }

    .add-connection-container {
      position: absolute;
      bottom: 30px;
      left: 0;
      right: 0;
    }
  }

  .connections-content {
    width: calc(100% - 250px);

    &.expanded { width: 100%; }
  }
}
